Conversation
|
This won't be probably backwards compatible right? Can I specify if I want run something as root? |
This comment was marked as outdated.
This comment was marked as outdated.
jakubno
left a comment
There was a problem hiding this comment.
I think we just need to be able to pass user. Otherwise, someone might need to run something as root, leading to the same issue.
|
|
||
| # Change ownership of all files to user | ||
| RUN chown -R user:user $HOME | ||
|
|
||
| USER user |
There was a problem hiding this comment.
why are you doing it as last thing? If you would set the user as a first thing you probably don't need change the ownership
There was a problem hiding this comment.
the problem here is: "user" does not exist in python image
and we cannot add user before we have "sudo" dependency installed
so this is why it's the last
|
I created a new template, |
| dockerfile = "e2b.Dockerfile" | ||
| template_name = "code-interpreter-v1" | ||
| template_id = "nlhz8vlwyupq845jsdg9" | ||
| start_cmd = "sudo -u user /home/user/.jupyter/start-up.sh" |
There was a problem hiding this comment.
one thing: this is a breaking change, should I put a script in /root/.jupyter/start-up.sh that just calls the actual start-up.sh with sudo -u user?
|
|
||
| # Copy matplotlibrc | ||
| COPY matplotlibrc /root/.config/matplotlib/.matplotlibrc | ||
| COPY matplotlibrc $HOME/.config/matplotlib/matplotlibrc |
There was a problem hiding this comment.
There's a path inconsistency between the Dockerfile and startup script. In the Dockerfile, the matplotlibrc file is copied to $HOME/.config/matplotlib/matplotlibrc (without a dot prefix), but in start-up.sh it's referenced as $HOME/.config/matplotlib/.matplotlibrc (with a dot prefix).
To resolve this, either:
- Update this line to include the dot prefix:
COPY matplotlibrc $HOME/.config/matplotlib/.matplotlibrc, or - Update the path in
start-up.shto remove the dot prefix:MATPLOTLIBRC=$HOME/.config/matplotlib/matplotlibrc
This will ensure the file is correctly located where the startup script expects to find it.
| COPY matplotlibrc $HOME/.config/matplotlib/matplotlibrc | |
| COPY matplotlibrc $HOME/.config/matplotlib/.matplotlibrc |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Sample code